Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/unable to login #1206

Closed

Conversation

Hemant77777777
Copy link

#1195 fixes

Description

This pull request introduces updates to the login functionality of the project. The changes ensure that the login endpoint works correctly by:

Validating user input (email and password).

Fetching user details from the database.

Validating the user's credentials and account status.

Generating a JWT token upon successful login.

Related Issues

This resolves the issue: Error: Route.post() requires a callback function but got a [object Undefined], ensuring that the login route is functional.

Steps to Test

Restart the backend server.

Use Postman or cURL to send a POST request to /api/login with the following JSON body:

{
"email": "[email protected]",
"password": "password"
}

Verify that a successful response contains a JWT token and user details.

Test invalid scenarios (e.g., incorrect password, non-existent email) to ensure proper error handling.

I have tested these changes locally and ensured they work as expected.
I have added relevant unit tests and integration tests (if applicable).
I have updated the documentation to reflect the changes.
I have commented my code, especially in complex areas, for clarity.
I have ensured the code adheres to the project's coding standards and style guidelines.
I have made corresponding changes to dependent modules or files.
My changes generate no new warnings or errors.
I have checked for potential security vulnerabilities in the added or modified code.
The title of my pull request is clear, concise, and descriptive.
This pull request is ready for review by the team.
Screenshot (357)
Screenshot (358)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant